home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: MegaDisc
/
MegaDisc 28 (1992-05)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).zip
/
MegaDisc 28 (1992-05)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).adf
/
Programming
/
ILBM_Prog
/
ILBM_Code
/
ilbm.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-26
|
3KB
|
66 lines
/* ILBM.h - O.K. the stuff to weed out differnt sections from */
/* an ILBM file. */
#define MakeID(a,b,c,d) ((LONG)(a)<<24L | (LONG)(b)<<16L | (c)<<8 | (d))
#define ID_FORM MakeID('F','O','R','M') /* these are the abbreviations */
#define ID_ILBM MakeID('I','L','B','M') /* LONG data type of all relevant*/
#define ID_BMHD MakeID('B','M','H','D') /* ILBM chunk descriptions */
#define ID_CMAP MakeID('C','M','A','P')
#define ID_BODY MakeID('B','O','D','Y')
#define ID_ACBM MakeID('A','C','B','M')
#define ID_ABIT MakeID('A','B','I','T')
struct FormHeader { /* these are the structure definitions for ILBM */
ULONG Header;
ULONG Size;
ULONG Type;
};
struct ChunkHeader {
ULONG Header;
ULONG Size;
} ;
#define mskNone 0 /* Masking techniques. */
#define mskHasMask 1
#define mskHasTransparentColour 2
#define mskLasso 3
#define cmpNone 0 /* Compression techniques */
#define cmpByteRun1 1
struct BitMapHeader {
UWORD width, height; /* raster width & height in pixels */
WORD x, y; /* pixel position for this image */
UBYTE nPlanes; /* number of bit planes. */
UBYTE masking; /* choice of masking technique. */
UBYTE compression; /* compression type. */
UBYTE pad1; /* unused; ignore on read, read as 0 */
UWORD transparentColour; /* transparent "colour no." sort of */
UBYTE xAspect, yAspect; /* pixel aspect ratio width : height */
WORD pageWidth, pageHeight; /* source page size in pixels */
};
struct ColourRegister { /* use this for colour information */
UBYTE red, green, blue;
};
#define OK_USE_CMAP 0 /* flags for use of colour map chunk */
#define NO_USE_CMAP 1 /* see ILBM.c */
/* ILBM.c functions not returning int. */
VOID ReadCMAP(); /* Read the colour map into store */
VOID ReadABIT(); /* Read an ABIT chunk of ACBM file */
VOID ReadBitMAPheader(); /* Self explanitory. */
VOID ReadBODY(); /* To read the BODY chunk. */
VOID PlainRead(); /* body with no compression */
VOID ReadChunk(); /* Speaks for itself. Then decide what else */
VOID DumpChunk(); /* Not a useful ILBM/ACBM chunk. */
VOID FadeDown(); /* Fade up viewport from black to CMAP1 */
VOID FadeUp(); /* Fade viewport from CMAP1 to black. */
VOID BlackoutVP(); /* make CMAP2 black and load into viewport */
VOID PutCMAP(); /* put CMAP1 into viewport. */
/* th th th that's all folks... */